package com.zjyc.javaweb.controller;

import com.zjyc.javaweb.domain.po.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {
    @RequestMapping("/getAll")
    public String getAll(Model model, String name){
        List<User> userList = new ArrayList<>();
        userList.add(new User("1", "张三", 18, "man.png", 60));
        userList.add(new User("2", "李四", 28, "woman.png", 80));
        userList.add(new User("3", "王五", 38, "man.png", 100));

        model.addAttribute("userList", userList);
        model.addAttribute("name", name);
        return "demo/User";
    }
}
